#include "junix.h"
using namespace std;

int main(int argc, char **argv)
{
	string s="hello,world!";
	cout<<string(s,3)<<endl;
	cout<<string(s,2,2)<<endl;

	cout<<string(s.begin(),s.end())<<endl;
	cout<<string(s.begin()+6,s.end())<<endl;
	cout<<string(s.begin()+s.find(",")+1, s.end())<<endl;

	cout<<*s.begin()<<endl;

	copy(s.rbegin(),s.rend(),ostream_iterator<char>(cout));
	cout<<endl;

//	cout<<s.reverse()<<endl;
	copy(s.rbegin(),s.rend(),s.begin());
	cout<<s<<endl;

	s="hello,world!";
	reverse(s.begin(),s.end());
	cout<<s<<endl;

	cout<<s.length()<<endl;
	cout<<s.size()<<endl;

	char buf[]="hello,junix.";
	cout<<string(buf)<<endl;
	cout<<string(buf, 5)<<endl;
	reverse(s.begin(),s.end());
	cout<<string(s.begin(),s.begin()+5)<<endl;

	cout<<string(100,'(')<<endl;
}
